/*
 * 全局样式文件 - Global Styles
 * 定义整个应用的基础样式、重置样式、通用类等
 */

/* 引入猫啃硬笔楷书字体 - 本地字体文件 */
@font-face {
  font-family: 'Maoken YingBi KaiShu';
  src: url('./assets/fonts/MaokenYingBiKaiShuJ_0.09.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* CSS变量定义 - 主题支持 */
:root {
  /* 全局字体变量 - 统一管理 */
  --global-font: 'Maoken YingBi KaiShu', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  
  /* 日间模式 */
  --bg-primary: #fff;
  --bg-secondary: #f5f5f5;
  --text-primary: #1890ff;
  --text-secondary: #666;
  --text-tertiary: #999;
  --border-color: #e8e8e8;
  --shadow-color: rgba(0, 0, 0, 10%);
}

[data-theme='dark'] {
  /* 夜间模式 */
  --bg-primary: #2a2a2a;
  --bg-secondary: #1f1f1f;
  --text-primary: #fff;
  --text-secondary: #ccc;
  --text-tertiary: #999;
  --border-color: #404040;
  --shadow-color: rgba(255, 255, 255, 10%);
}

/* 盒模型重置 */
* {
  box-sizing: border-box;

  /* 添加平滑过渡动画 - 包含 opacity 和 transform */
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

/* 全局通配符 - 确保所有元素都使用统一字体 */
* {
  font-family: var(--global-font) !important;
  font-weight: 640 !important; /* 粗体 - bold */
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--global-font) !important;
  font-weight: 700 !important; /* 粗体 */
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

#root {
  min-height: 100vh;
}

/* 全局滚动条样式 - 普通样式带渐入渐出效果 */
* {
  /* Firefox 滚动条 */
  scrollbar-width: thin !important;
  scrollbar-color: transparent transparent !important;
  transition: scrollbar-color 0.3s ease !important;
}

*:hover {
  scrollbar-color: #1890ff #f0f5ff !important;
}

*::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
}

*::-webkit-scrollbar-track {
  background: #f0f5ff !important;
  border-radius: 4px !important;
  opacity: 0 !important;
  transition: opacity 0.8s ease-in-out !important;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #69c0ff 0%, #1890ff 100%) !important;
  border-radius: 4px !important;
  opacity: 0 !important;
  transition: opacity 0.8s ease-in-out, background 0.3s ease !important;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #91d5ff 0%, #40a9ff 100%) !important;
  opacity: 1 !important;
}

/* 悬停或滚动时显示滚动条 */
*:hover::-webkit-scrollbar-track,
*.scrolling::-webkit-scrollbar-track,
body.scrolling::-webkit-scrollbar-track,
html.scrolling::-webkit-scrollbar-track {
  opacity: 1 !important;
}

*:hover::-webkit-scrollbar-thumb,
*.scrolling::-webkit-scrollbar-thumb,
body.scrolling::-webkit-scrollbar-thumb,
html.scrolling::-webkit-scrollbar-thumb {
  opacity: 1 !important;
}